package com.coffee.core.enums;

public enum SkuOrderStatusEnum {
    CANCEL("cancel", "取消"),
    WAITINGCANCEL("waitCancel", "等待取消"),
    WAITING("waiting", "待付款"),
    PAY("pay", "已支付"),
    WAITDELIVER("waitdeliver", "设置物流"),
    DELIVER("deliver", "发货"),
    SUCCESS("success", "确认收获"),
    APPLYING("applying", "申请中"),
    REFUSE("refuse", "退款拒绝"),
    CANCELREFUSE("cancelRefuse", "取消拒绝"),
    APPLYSUCCESS("applysuccess", "退款成功"),
    CANCELSUCCESS("cancelsuccess", "取消成功"),
    PASS("pass", "退款通过");

    private String code;
    private String name;

    private SkuOrderStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static SkuOrderStatusEnum getByCode(String code) {
        for (SkuOrderStatusEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }

        return WAITING;
    }
}
